/* CONTROVERSY AND COSTS */

*QUALTRICS 2019B DATA

use Controversy_and_Costs_Replication_Qualtrics2019B.dta // note:  Stata v.13

*************
*Figure 1
*Note: Some additional formatting may have been done using Graph Editor
*************

mean polcon_ID polcon_watch polcon_wall polcon_ban polcon_green
estimates store controversy_means

*install coefplot package
*install "blindschemes" Stata scheme package 
coefplot controversy_means, scheme(plotplain)

ttest polcon_ID == polcon_green // paired t-test: ID significantly lower than next-lowest issue

*************
* Familiarity with Voter ID Laws
*************
tab vid_familiar // distribution of familiarity
tabstat vid_familiar, st(mean sd) // mean and SD

*************
* Correlation b/w familiarity with VID laws and perceived controversy
*************
pwcorr vid_familiar polcon_ID, sig // r=.21

*************
*Figure 2 (Correlation between perceived controversy and VID support)
*Note: Some additioning formatting may have been done using Graph Editor
*************
pwcorr polcon_ID vid, sig
pwcorr polcon_ID vid if party==1, sig // Dems
pwcorr polcon_ID vid if party==3, sig // Reps

*install binscatter
	*All
binscatter vid polcon_ID, scheme(plotplain)

	*Democrats
binscatter vid polcon_ID if party==1, scheme(plotplain) 

	*Republicans
binscatter vid polcon_ID if party==3, scheme(plotplain) 

*************
*Figure 5 (Perceived possession of ID)
*Note: Some additional formatting may have been done using Graph Editor
*************
tab vid_posses // 69% believed nearly all adult citizens probably have ID

mean vid, over(vid_posses)
estimates store vidpossess
coefplot, scheme(plotplain)

*Binary analysis (see Supplemental Appendix)
reg vid_binary i.vid_posses


*************
*Table 3 (Correlation between perceived cost of obtaining ID and support for VID)
*************
*Correlations
pwcorr diff_car vid, sig obs // Driver's license
pwcorr diff_other vid, sig obs // Other official ID
pwcorr diff_soc vid, sig obs // Social Security card
pwcorr diff_birth vid, sig obs // Birth certificate
pwcorr diff_pass vid, sig obs // U.S. passport
pwcorr diff_mil vid, sig obs // U.S. military ID

*Means and SDs
tabstat diff_car diff_other diff_soc diff_birth diff_pass diff_mil, st(mean sd)


*************
*Table 5 (Experimental effect of imposing costs)
*************

	*All respondents
reg vid_newID i.vid_treat

	*Democrats
reg vid_newID i.vid_treat if party==1

	*Republicans
reg vid_newID i.vid_treat if party==3


*Binary outcome analyses (see Supplemental Appendix)
reg vid_newID_binary i.vid_treat // All
reg vid_newID_binary i.vid_treat if party==1 // Democrats
reg vid_newID_binary i.vid_treat if party==3 // Republicans

*************
*************
